<template>
  <div class="demo">
    <h1>学生名称:{{ name }}</h1>
    <h1>学生性别:{{ sex }}</h1>
    <button @click="showName">点击弹窗展示姓名</button>
  </div>
</template>

<script>
// 引入公共的逻辑
import { mixin } from "../mixin";
export default {
  name: "Student",
  data() {
    return {
      name: "陈嘉兴",
      sex: "男",
    };
  },
  // 使用公共的逻辑
  mixins: [mixin],
};
</script>

<style>
.demo {
  background-color: blueviolet;
}
</style>